// 分页组件
<template>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :page-sizes="[1, 2, 5, 10]"
      :page-size="pagesize"
      :current-page="pagenum"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
    </el-pagination>
</template>
<script>
export default {
  props: {
    pagenum: {
      type: Number,
      default: 1
    },
    pagesize: {
      type: Number,
      default: 2
    },
    total: {
      type: Number,
      default: 100
    }
  },
  methods: {
    handleSizeChange (newSize) {
      this.$emit('NewSize', newSize)
    },
    handleCurrentChange (newPage) {
      this.$emit('NewPage', newPage)
    }
  }
}
</script>
